<?php
	function selectUser($username, $password) {
		$data = new DBAccess();
		$sql = "select * from nhanvien where tennv ='$username' and matkhau = '$password' ";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function insertUser($hoten, $ngaysinh,$cmnd,$email,$diachi,$tendangnhap,$matkhau,$gioitinh,$hinhanh)
	{
		$data = new DBAccess();
		$sql = "insert into nhanvien (tennv,ngaysinh,socmnd,email,diachi,tendangnhap,matkhau,gioitinh,hinhanh)values('$tendangnhap','$ngaysinh','$cmnd','$email','$diachi','$tendangnhap','$matkhau','$gioitinh','$hinhanh')";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function deleteUser($manv)
	{
		$data = new DBAccess();
		$sql = "delete from nhanvien where manv ='$manv'";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function checkUser($username) {
		$data = new DBAccess();
		$sql = "select * from nhanvien where tendangnhap ='$username'";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function checkemail($email) {
		$data = new DBAccess();
		$sql = "select * from nhanvien where email ='$email'";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function checkcmnd($cmnd) {
		$data = new DBAccess();
		$sql = "select * from nhanvien where socmnd ='$cmnd'";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
?>